#pragma once
#include "stdafx.h"

namespace Network
{
	class SOCK_Stream {
	public:
		SOCK_Stream() : handle_ (NULL) { }
		SOCK_Stream(HANDLE h) : handle_ (handle_) { }
		SOCK_Stream(const SOCK_Stream& ss );

		void SetHandle(HANDLE h);
		HANDLE GetHandle(void);

		~SOCK_Stream() { 
			//Don't kill the connection, we might need it after local SOCK_Stream variable is not used anymore
			//closesocket((SOCKET)handle_); 
		};

		int send(const char *buffer, size_t buffer_size, int flags);
		int receive(void *buffer, size_t buffer_size, int flags);
		void close();
	private:
		HANDLE handle_;
	};

}